import { createApp } from 'vue';
import pinia from './stores/index';
import App from './App.vue';
import router from './router';
import { directive } from '/@/utils/directive';
import other from '/@/utils/other';
import * as dayjs from 'dayjs';
import * as utils from '/@/utils';
import * as filters from '/@/utils/filters';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import base from '/@/components/base';
import * as ElIconModules from '@element-plus/icons-vue';
import '/@/theme/index.scss';
import mitt from 'mitt';

const app = createApp(App);

directive(app);
other.elSvg(app);
app.config.globalProperties.$utils = utils;
app.config.globalProperties.$filters = filters;
app.config.globalProperties.$dayjs = dayjs;
app.use(ElementPlus);
app.use(base);
Object.keys(ElIconModules).forEach(function (key) {
	app.component(ElIconModules[key].name, ElIconModules[key]);
});
app.use(pinia).use(router).mount('#app');
app.config.globalProperties.mittBus = mitt();
